﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="ViewMatches.aspx.cs" Inherits="TsWeb.Followers.ViewMatches" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="LeftContent" runat="server">
    <div>
        <ul>
            <div class="accordion" id="accordion2">
                <div class="accordion-group">
                    <div class="accordion-heading">
                        <li class="nav-header" data-toggle="collapse" data-parent="#accordion2" href="#collapseOne">
                            Tabla de posiciones</li>
                    </div>
                    <div id="collapseOne" class="collapse in">
                        <div class="accordion-inner">
                            <h6>
                                Selecione un deporte</h6>
                            <asp:DropDownList ID="ComboBoxSports" runat="server" DataTextField="Name" AutoPostBack="true"
                                DataValueField="SportId" OnSelectedIndexChanged="ComboBoxSports_SelectedIndexChanged">
                            </asp:DropDownList>


                            <asp:GridView ID="GridViewPositions" runat="server" AutoGenerateColumns="false" CssClass="table table-hover table-striped">
                                <Columns>
                                    <asp:BoundField DataField="TeamPosition" HeaderText="Posicion" />
                                    <asp:TemplateField HeaderText="Equipo">
                                        <ItemTemplate>
                                            <asp:Label ID="LabelHomeTeam" runat="server" Text='<%# Bind("Team.Name") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:BoundField DataField="Points" HeaderText="Puntaje" />
                                </Columns>
                            </asp:GridView>
                        </div>
                    </div>
        </ul>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
        <Scripts>
            <asp:ScriptReference Path="~/Scripts/jquery-1.9.1.js" />
            <asp:ScriptReference Path="~/Scripts/bootstrap.min.js" />
            <asp:ScriptReference Path="~/Scripts/uploadfile.js" />
        </Scripts>
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel2" runat="server">
        <Triggers>
            <asp:PostBackTrigger ControlID="UserButton" />
        </Triggers>
        <ContentTemplate>
            <asp:GridView ID="MatchesGrid" runat="server" AutoGenerateColumns="False" OnRowCommand="MatchesGrid_RowCommand"
                CssClass="table table-hover table-striped" GridLines="None" OnRowDataBound="MatchesGrid_RowDataBound">
                <Columns>
                    <asp:BoundField DataField="MatchId" HeaderText="MatchId" ControlStyle-CssClass="hidden"
                        HeaderStyle-CssClass="hidden" ItemStyle-CssClass="hidden" />
                    <asp:BoundField DataField="Date" HeaderText="Fecha" />
                    <asp:TemplateField HeaderText="Locatario">
                        <ItemTemplate>
                            <asp:Label ID="LabelHomeTeam" runat="server" Text='<%# Bind("HomeTeam.Name") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Visitante">
                        <ItemTemplate>
                            <asp:Label ID="LabelVisitorTeam" runat="server" Text='<%# Bind("VisitorTeam.Name") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="Winner" HeaderText="Ganador" />
                    <asp:ButtonField ButtonType="Link" CommandName="AddMediaCommand" Text="Subir contenido" />
                </Columns>
            </asp:GridView>
            <div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
                aria-hidden="true">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                        ×</button>
                    <h4 id="myModalLabel">
                        Subir fotos y videos
                    </h4>
                </div>
                <div class="modal-body">
                    <p>
                        &nbsp;<ajaxToolkit:AsyncFileUpload ID="AsyncFileUpload1" runat="server" ploaderStyle="Modern"
                            Width="275px" ThrobberID="lbluploadprogress" OnUploadedComplete="AsyncFileUpload1_UploadedComplete"
                            UploadingBackColor="#66CCFF" />
                        <p>
                            <asp:Label ID="lbluploadprogress" runat="server" Style="color: #FF3300" Text="Upload in progress..." />
                            <p>
                            </p>
                </div>
                <div class="modal-footer">
                    <asp:Button ID="UserButton" runat="server" Text="Actualizar equipo" CssClass="btn btn-primary"
                        OnClick="UpdateMatchButton_Click" />
                </div>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
